package com.zatech.cgnci.project.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;

/**
 * @author EDY
 * @version 1.0
 * Create by 2024/12/18 14:55
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "CgnciApprovalConfigAuthUserDTO")
public class CgnciApprovalConfigAuthUserDTO {

    @NotEmpty(message = "configTypes cannot be empty")
    @Valid
    private List<ConfigType> configTypes;

    @ApiModelProperty("代理人名字")
    @NotBlank(message = "currentApproverName cannot be null")
    private String currentApproverName;

    @ApiModelProperty("代理人工号")
    @NotBlank(message = "currentApprover cannot be null")
    private String currentApprover;

    @ApiModelProperty("起期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT-8")
    private Date startDate;

    @ApiModelProperty("止期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT-8")
    private Date endDate;

    @ApiModelProperty("备注")
    private String remark;

    @Data
    public static class ConfigType {

        @ApiModelProperty("任务类型")
        @NotBlank(message = "taskType cannot be null")
        private String taskType;

        @ApiModelProperty("任务类型编码")
        @NotBlank(message = "taskTypeCode cannot be null")
        private String taskTypeCode;

    }

}
